package com.zhht.checkcop.db;

import com.zhht.checkcop.db.ParkVO;

/**
 * @title: 停车场VO
 * @copyright: copyright (c) 2018
 * @company: 智慧互通科技有限公司
 * @author: chengkaijing
 * @date: 2018年6月14 下午4:50:58
 * @firstReview:
 * @lastReview:
 * @desc:
 */
public class ParkVO2 {
    private Long parkId;
    private String parkName;
    private Integer amount;         //总泊位
    private Integer used;
    private Integer remains;        //剩余泊位
    //2018-10-11  余宗清新增parkCode属性
    private String parkCode;

    private Long parentId;

    public ParkVO2(ParkVO park) {
        this.parkId = park.getParkId();
        this.parkName = park.getParkName();
        this.amount = park.getAmount();
        this.parkCode = park.getParkCode();
    }

    public ParkVO2(ParkVO park, Integer used) {
        this.parkId = park.getParkId();
        this.parkCode = park.getParkCode();
        this.parkName = park.getParkName();
        this.amount = park.getAmount();
        this.used = used;
        if (amount == null) {
            this.remains = 0;
        } else {
            this.remains = amount - used;
            if (this.remains < 0) {
                this.remains = 0;
            }
        }
    }

    public ParkVO2(Park park, Integer used) {
        this.parkId = park.getParkId();
        this.parkCode = park.getParkCode();
        this.parkName = park.getParkName();
        this.amount = park.getAmount();
        this.parentId = park.getParentId();
        this.used = used;
        if (amount == null) {
            this.remains = 0;
        } else {
            this.remains = amount - used;
            if (this.remains < 0) {
                this.remains = 0;
            }
        }
    }

    public Long getParkId() {
        return parkId;
    }

    public void setParkId(Long parkId) {
        this.parkId = parkId;
    }

    public String getParkName() {
        return parkName;
    }

    public void setParkName(String parkName) {
        this.parkName = parkName;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Integer getUsed() {
        return used;
    }

    public void setUsed(Integer used) {
        this.used = used;
    }

    public Integer getRemains() {
        return remains;
    }

    public void setRemains(Integer remains) {
        this.remains = remains;
    }

    public String getParkCode() {
        return parkCode;
    }

    public void setParkCode(String parkCode) {
        this.parkCode = parkCode;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
}
